<?php

/**
 * Celebrity filter form base class.
 *
 * @package    iEasy
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseCelebrityFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'name'              => new sfWidgetFormFilterInput(),
      'create_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'modify_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'snapshot_big'      => new sfWidgetFormFilterInput(),
      'snapshot_small'    => new sfWidgetFormFilterInput(),
      'hit_i'             => new sfWidgetFormFilterInput(),
      'hit_mask_i'        => new sfWidgetFormFilterInput(),
      'status_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Status'), 'add_empty' => true)),
      'tag'               => new sfWidgetFormFilterInput(),
      'source'            => new sfWidgetFormFilterInput(),
      'catalog_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'add_empty' => true)),
      'keyword'           => new sfWidgetFormFilterInput(),
      'member_level_i'    => new sfWidgetFormFilterInput(),
      'content_type_i'    => new sfWidgetFormFilterInput(),
      'company_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Company'), 'add_empty' => true)),
      'office_site_links' => new sfWidgetFormFilterInput(),
      'english_name'      => new sfWidgetFormFilterInput(),
      'sex'               => new sfWidgetFormFilterInput(),
      'career'            => new sfWidgetFormFilterInput(),
      'country'           => new sfWidgetFormFilterInput(),
      'location'          => new sfWidgetFormFilterInput(),
      'birthday'          => new sfWidgetFormFilterInput(),
      'horoscope'         => new sfWidgetFormFilterInput(),
      'height'            => new sfWidgetFormFilterInput(),
      'weight'            => new sfWidgetFormFilterInput(),
      'blood_type'        => new sfWidgetFormFilterInput(),
      'school'            => new sfWidgetFormFilterInput(),
      'brief'             => new sfWidgetFormFilterInput(),
      'celebrity_type'    => new sfWidgetFormFilterInput(),
      'is_audit_b'        => new sfWidgetFormFilterInput(),
      'daily_hit'         => new sfWidgetFormFilterInput(),
      'weekly_hit'        => new sfWidgetFormFilterInput(),
      'monthly_hit'       => new sfWidgetFormFilterInput(),
      'capital_letter'    => new sfWidgetFormFilterInput(),
      'work_date'         => new sfWidgetFormFilterInput(),
      'system_user_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
      'is_recommend_b'    => new sfWidgetFormFilterInput(),
      'is_on_top_b'       => new sfWidgetFormFilterInput(),
      'publish_time'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'member_num_i'      => new sfWidgetFormFilterInput(),
      'company_name'      => new sfWidgetFormFilterInput(),
      'c_type'            => new sfWidgetFormFilterInput(),
      'band_name'         => new sfWidgetFormFilterInput(),
      'band_member'       => new sfWidgetFormFilterInput(),
      'band_color'        => new sfWidgetFormFilterInput(),
      'band_slogan'       => new sfWidgetFormFilterInput(),
      'mascot'            => new sfWidgetFormFilterInput(),
      'fans_name'         => new sfWidgetFormFilterInput(),
      'stage_name'        => new sfWidgetFormFilterInput(),
      'foreign_name'      => new sfWidgetFormFilterInput(),
      'friends'           => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'name'              => new sfValidatorPass(array('required' => false)),
      'create_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'modify_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'snapshot_big'      => new sfValidatorPass(array('required' => false)),
      'snapshot_small'    => new sfValidatorPass(array('required' => false)),
      'hit_i'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'hit_mask_i'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'status_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Status'), 'column' => 'status_id')),
      'tag'               => new sfValidatorPass(array('required' => false)),
      'source'            => new sfValidatorPass(array('required' => false)),
      'catalog_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Catalog'), 'column' => 'catalog_id')),
      'keyword'           => new sfValidatorPass(array('required' => false)),
      'member_level_i'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'content_type_i'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'company_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Company'), 'column' => 'company_id')),
      'office_site_links' => new sfValidatorPass(array('required' => false)),
      'english_name'      => new sfValidatorPass(array('required' => false)),
      'sex'               => new sfValidatorPass(array('required' => false)),
      'career'            => new sfValidatorPass(array('required' => false)),
      'country'           => new sfValidatorPass(array('required' => false)),
      'location'          => new sfValidatorPass(array('required' => false)),
      'birthday'          => new sfValidatorPass(array('required' => false)),
      'horoscope'         => new sfValidatorPass(array('required' => false)),
      'height'            => new sfValidatorPass(array('required' => false)),
      'weight'            => new sfValidatorPass(array('required' => false)),
      'blood_type'        => new sfValidatorPass(array('required' => false)),
      'school'            => new sfValidatorPass(array('required' => false)),
      'brief'             => new sfValidatorPass(array('required' => false)),
      'celebrity_type'    => new sfValidatorPass(array('required' => false)),
      'is_audit_b'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'daily_hit'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'weekly_hit'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'monthly_hit'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'capital_letter'    => new sfValidatorPass(array('required' => false)),
      'work_date'         => new sfValidatorPass(array('required' => false)),
      'system_user_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Systemuser'), 'column' => 'system_user_id')),
      'is_recommend_b'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_on_top_b'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'publish_time'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'member_num_i'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'company_name'      => new sfValidatorPass(array('required' => false)),
      'c_type'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'band_name'         => new sfValidatorPass(array('required' => false)),
      'band_member'       => new sfValidatorPass(array('required' => false)),
      'band_color'        => new sfValidatorPass(array('required' => false)),
      'band_slogan'       => new sfValidatorPass(array('required' => false)),
      'mascot'            => new sfValidatorPass(array('required' => false)),
      'fans_name'         => new sfValidatorPass(array('required' => false)),
      'stage_name'        => new sfValidatorPass(array('required' => false)),
      'foreign_name'      => new sfValidatorPass(array('required' => false)),
      'friends'           => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('celebrity_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Celebrity';
  }

  public function getFields()
  {
    return array(
      'celebrity_id'      => 'Number',
      'name'              => 'Text',
      'create_time'       => 'Date',
      'modify_time'       => 'Date',
      'snapshot_big'      => 'Text',
      'snapshot_small'    => 'Text',
      'hit_i'             => 'Number',
      'hit_mask_i'        => 'Number',
      'status_id'         => 'ForeignKey',
      'tag'               => 'Text',
      'source'            => 'Text',
      'catalog_id'        => 'ForeignKey',
      'keyword'           => 'Text',
      'member_level_i'    => 'Number',
      'content_type_i'    => 'Number',
      'company_id'        => 'ForeignKey',
      'office_site_links' => 'Text',
      'english_name'      => 'Text',
      'sex'               => 'Text',
      'career'            => 'Text',
      'country'           => 'Text',
      'location'          => 'Text',
      'birthday'          => 'Text',
      'horoscope'         => 'Text',
      'height'            => 'Text',
      'weight'            => 'Text',
      'blood_type'        => 'Text',
      'school'            => 'Text',
      'brief'             => 'Text',
      'celebrity_type'    => 'Text',
      'is_audit_b'        => 'Number',
      'daily_hit'         => 'Number',
      'weekly_hit'        => 'Number',
      'monthly_hit'       => 'Number',
      'capital_letter'    => 'Text',
      'work_date'         => 'Text',
      'system_user_id'    => 'ForeignKey',
      'is_recommend_b'    => 'Number',
      'is_on_top_b'       => 'Number',
      'publish_time'      => 'Date',
      'member_num_i'      => 'Number',
      'company_name'      => 'Text',
      'c_type'            => 'Number',
      'band_name'         => 'Text',
      'band_member'       => 'Text',
      'band_color'        => 'Text',
      'band_slogan'       => 'Text',
      'mascot'            => 'Text',
      'fans_name'         => 'Text',
      'stage_name'        => 'Text',
      'foreign_name'      => 'Text',
      'friends'           => 'Text',
    );
  }
}
